{{!
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements.  See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership.  The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License.  You may obtain a copy of the License at
*
*     http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
}}
<div class="panel panel-default">
  <div class="panel-heading">General</div>
  <div class="form-group padding10">
    <label class="control-label col-xs-2">Send As</label>
    <div class="col-xs-2">
      <input type="radio" name="sendType" checked={{if (eq isArg false) 'checked'}}  {{action "setIsArg" false preventDefault=false on="change"}}> Command
    </div>
    <div class="col-xs-2">
      <input type="radio" name="sendType" checked={{if (eq isArg true) 'checked'}}  {{action "setIsArg" true preventDefault=false on="change"}}> Args
    </div>
  </div>
  <div id="arg-option">
    {{#each actionModel.arg as |arg index|}}
      <div class="form-group">
        <label class="control-label col-xs-2 {{if (or (not-eq index 0) hideLabel) 'visibility-hidden'}}">Arg<span class="requiredField">&nbsp;*</span></label>
        <div class=" col-xs-7">
          {{input type="text" class="form-control" value=arg.value placeholder=title}}
        </div>
        {{#if (eq arg actionModel.arg.lastObject)}}
          <div class="col-xs-1">
            <input class="form-control btn btn-secondary" type="button" value="+" {{action "addArg"}}>
          </div>
        {{else}}
          <div class="col-xs-1">
            <input class="form-control btn btn-danger" type="button" {{action "deleteArg" index}} value="-">
          </div>
        {{/if}}
      </div>
    {{/each}}
    {{#if validations.attrs.actionModel.arg.isInvalid}}
      <div class="form-group">
        <label class="control-label col-xs-2"></label>
        <div class=" col-xs-7">
          {{field-error model=this field='actionModel.arg' showErrorMessage=showErrorMessage}}
        </div>
      </div>
    {{/if}}
  </div>
  <div id="command-option">
    <div class="form-group padding10">
      <label for="inputEmail" class="control-label col-xs-2">Command<span class="requiredField">&nbsp;*</span></label>
      <div class="col-xs-7">
        {{input type="text" class="form-control" name="command" value=actionModel.command placeholder="Command" title="eg. import --connect jdbc:hsqldb:file:db.hsqldb --table TT --target-dir /user/${wf:user()}/output-data/sqoop -m 1"}}
        {{field-error model=this field='actionModel.command' showErrorMessage=showErrorMessage}}
      </div>
    </div>
  </div>
  {{#jobxml-config jobXml=actionModel.jobXml openFileBrowser="openFileBrowser" register="register"}}{{/jobxml-config}}
</div>
<div class="panel panel-default">
  <div class="panel-heading">Transition</div>
  <div class="panel-body handlerPanel">
    {{#transition-config transition=transition killNodes=killNodes currentNode=currentNode register="register"}}{{/transition-config}}
  </div>
</div>
{{#action-credential-config credentials=credentials actionCredentials=actionModel.credentials}}{{/action-credential-config}}
<div class="panel panel-default">
  <div class="panel-heading" id="accordion" data-toggle="collapse" data-parent="#accordion" data-target="#collapseOne">
    <h4 class="panel-title">
      Advanced Properties
      <i class="indicator glyphicon glyphicon-chevron-down pull-right"></i></h4>
    </div>
    <div id="collapseOne" class="panel-collapse collapse">
      <br/>
      <div class=" panel panel-default">
        <div class="panel-body handlerPanel">
          <div class="form-group">
            <label for="inputEmail" class="control-label col-xs-2">Resource Manager</label>
            <div class="col-xs-7">
              {{input type="text" class="form-control" name="job-tracker" value=actionModel.jobTracker placeholder="Resource Manager"}}
            </div>
            {{field-error error=errors.actionModel.jobTracker}}
          </div>
          <div class="form-group">
            <label for="inputPassword" class="control-label col-xs-2">Name node</label>
            <div class="col-xs-7">
              {{input type="text" class="form-control"  name="name-node" value=actionModel.nameNode validations="required,noWhitespace" placeholder="Name node"}}
            </div>
          </div>
          {{#file-config files=actionModel.files openFileBrowser="openFileBrowser" register="register" title="File"}}{{/file-config}}
          {{#file-config files=actionModel.archives openFileBrowser="openFileBrowser" register="register" title="Archive"}}{{/file-config}}
          {{#prepare-config prepare=actionModel.prepare openFileBrowser="openFileBrowser" register="register"}}{{/prepare-config}}
        </div>
      </div>
      <div class=" panel panel-default">
        <div class="panel-heading">Configuration</div>
        <div class="panel-body handlerPanel">
          {{#name-value-config configuration=actionModel.configuration register="register"}}{{/name-value-config}}
        </div>
      </div>
    </div>
  </div>
  {{#sla-info slaInfo=actionModel.slaInfo register="register" slaEnabled=actionModel.slaEnabled register="register"}}{{/sla-info}}
